
INSTALLATION

1) Set up your Twilio account as described in twilio.txt
  - one SIP domain where you can register your softphones is created
  - you will need the following for the next steps:
    1) server name like phxbot135.sip.franfurt.twilio.com
    2) server port, usually 5060 (the default one)
    3) user name
    4) password

2) Set up your Google account and generate a credentials file as described in google.txt
  - this file will enable you to access Google API
  - save the file to google-credentials.json

3) Get software packages and a license file from Phonexia
  - SpeechEngine spe_3.36.0_lin64.deb
  - VoiceBot voicebot_0.5.0_lin64.deb
  - license.dat

4) Install SpeechEngine
  - copy the license.dat to /tmp (else the installation will ask for this file)
  - copy the google-credentials.json to /tmp (else the installation will ask for this file)
  - run the installation
    sudo apt-get install ./spe_3.36.0_lin64.deb
  - SpeechEngine is installed to /opt/spe
  - you can start/stop/restart the service using /opt/spe/{start,stop,restart}
  - the service runs as a systemd service
  - you can see the log using /opt/spe/show-log
  - the package installs SIP connector as a separate service to /opt/spe/sip-connector,
    you may use similar commands with this service too

5) Install voicebot backend
  - you may let the installation package configure the Asterisk PBX for you or configure it yourself
  - for the Asterisk configuration, you need a SIP server, port, user, and password
  - you can say 'yes' for the automatic Asterisk configuration and insert all the values during
    the installation
  - alternatively you may create the /tmp/sip.txt file with these four values on separate lines (raw 
    value on each line)
    server (phxbot135.sip.franfurt.twilio.com)
    port (5060)
    user (petr)
    password (xxxxxx)
  - run the isntallation
    sudo apt-get install ./voicebot_0.5.0_lin64.deb

Now everything should work, and you should be able to call your VoiceBot.
If you change any setting, it is necessary to restart the services using /opt/voicebot/restart


SERVICES AND PORTS

Asterisk/SIP 127.0.0.1:5060
SpeechEngine/REST 127.0.0.1:8600
SpeechEngine/RTP 127.0.0.1:10000 (range start)
SIP Connector/REST 127.0.0.1:8090
Voicebot/REST 127.0.0.1:8091 (webhooks from SIP connector)


TESTS
It was tested with Ubuntu 20.04.2 LTS that run in VirtualBox 6.1.1 executed from Windows 10.
The VirtualBox networking is set to the NAT mode. And there is another NAT separating the Windows 
machine and internet. It is essential that both NAT always assigns the same output port for the 
combination of source IP/port and target IP/port. VirtualBox NAT uses a random output port for each 
session by default. This needs to be reconfigured. See virtualbox.txt

